package com.ljf.tijian.config;

import com.ljf.tijian.Interceptor.JWTInterceptor;
import com.ljf.tijian.Interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class TijianWebInterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new JWTInterceptor())
                .addPathPatterns("/**").order(10)
                .excludePathPatterns("/login","register","/smsget","/smslogin");

        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/login","/register","/smsget","/smslogin","/countOrder","/countOrderForHp",
                        "/alipay/pay","/alipay/notify","/countOrder",
                        "/countOrderForHp","/test","/ai/kimi","/chat","/insertanswer","/queryquestion").order(20);
    }
}

//,"/listAllHospital","/getHospitalById",
//        "/listCalendar",
//        "/getallreports","/getreportconclusion","/getreportdetail"